Skip to content

feat: added Get/Set Environment on Scope - #5772

Open
bitsandfoxes wants to merge 12 commits into
mainfrom
feat/scope-set-environment
Open

feat: added Get/Set Environment on Scope#5772
bitsandfoxes wants to merge 12 commits into
mainfrom
feat/scope-set-environment

Conversation

@bitsandfoxes

@bitsandfoxes bitsandfoxes commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

📜 Description

Adds a getter and setter to the scope that allows users to configure the Environment at runtime.

💡 Motivation and Context

See #5769

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 8da38a8

@sentry

sentry Bot commented Jul 16, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.50.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 315.02 ms 355.28 ms 40.26 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
05aa61d 326.06 ms 385.46 ms 59.40 ms
bb0ff41 315.84 ms 350.76 ms 34.92 ms
806307f 357.85 ms 424.64 ms 66.79 ms
d501a7e 307.33 ms 341.94 ms 34.61 ms
0ee65e9 321.06 ms 361.24 ms 40.18 ms
ed33deb 334.19 ms 362.30 ms 28.11 ms
9fbb112 401.87 ms 515.87 ms 114.00 ms
b8bd880 314.56 ms 336.50 ms 21.94 ms
5b1a06b 315.40 ms 353.33 ms 37.94 ms
6edfca2 316.43 ms 398.90 ms 82.46 ms

App size

Revision Plain With Sentry Diff
05aa61d 0 B 0 B 0 B
bb0ff41 0 B 0 B 0 B
806307f 1.58 MiB 2.10 MiB 533.42 KiB
d501a7e 0 B 0 B 0 B
0ee65e9 0 B 0 B 0 B
ed33deb 1.58 MiB 2.13 MiB 559.52 KiB
9fbb112 1.58 MiB 2.11 MiB 539.18 KiB
b8bd880 1.58 MiB 2.29 MiB 722.92 KiB
5b1a06b 0 B 0 B 0 B
6edfca2 1.58 MiB 2.13 MiB 559.07 KiB

Previous results on branch: feat/scope-set-environment

Startup times

Revision Plain With Sentry Diff
e9c4258 339.22 ms 436.33 ms 97.10 ms
284a8f9 319.11 ms 381.14 ms 62.03 ms
62d5092 312.19 ms 327.22 ms 15.03 ms
9f4de8c 324.54 ms 361.39 ms 36.85 ms

App size

Revision Plain With Sentry Diff
e9c4258 0 B 0 B 0 B
284a8f9 0 B 0 B 0 B
62d5092 0 B 0 B 0 B
9f4de8c 0 B 0 B 0 B

…nment

# Conflicts:
#	sentry-android-core/src/main/java/io/sentry/android/core/ApplicationExitInfoEventProcessor.java
#	sentry-android-core/src/test/java/io/sentry/android/core/ApplicationExitInfoEventProcessorTest.kt
@bitsandfoxes
bitsandfoxes marked this pull request as ready for review July 17, 2026 13:17
Comment thread sentry/src/main/java/io/sentry/Scope.java
Comment thread sentry/src/main/java/io/sentry/Scope.java

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 879e15a. Configure here.

Comment thread sentry/src/main/java/io/sentry/SentryClient.java
Comment thread sentry/src/main/java/io/sentry/Scope.java
Comment thread sentry/src/main/java/io/sentry/Sentry.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant